home *** CD-ROM | disk | FTP | other *** search
- /* system.c--- BIBLE pp. 103-104 */
- #include <stdio.h>
- #include <stdlib.h>
- main()
- {
- char command[80];
- while(1)
- {
- printf("Enter command (\"quit\" to exit):");
- gets(command);
- strlwr(command);
- /* Exit if user typed "quit" */
- if(strcmp(command, "quit") == 0)
- exit(0);
- /* Otherwise pass command to a copy of COMMAND.COM */
- if(system(command) == 1)
- {
- perror("error in system");
- }
- }
- }